<?php
/* Template Name: Training Page */
?>

<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */

get_header(); include( locate_template( 'block-header-training.php' ) ); /*get_template_part('block', 'training');*/
?>

<section class="fix">
    <div class="main-left">
        <div class="box-education animated-area" id="box-education">
            <div class="description">
                <?php the_content('Read more...'); ?>
            </div>
            <?php
            $ss = 0.6;  foreach ( $tab_details as $post ):?>
            <article class="item animated" data-animation="fade-in-up" data-animation-delay="<?php echo $ss;?>s" data-animation-duration="1s">
                <h3 class="title"><?php echo $post['tab_detail_title']; ?></h3>
                <div class="content">
                    <?php echo $post['tab_detail_content']; ?>
                </div>
            </article>
            <?php $ss+=0.3;endforeach;?>
            <a href="#box-register" title="ĐĂNG KÝ KHÓA HỌC" rel="popup" class="btn-join  animated" data-animation="fade-in-up" data-animation-delay="2.1s" data-animation-duration="1s">Đăng ký khóa học</a>
        </div>
        <div class="box-customer animated-area">
            <div class="title">KHÁCH HÀNG</div>
            <div class="data">
                <?php foreach($tab_customer as $k=>$cu):?>
                <div class="item animated" data-animation="bounce-in" data-animation-delay="<?php echo ($k+2)*0.3; ?>s">
                    <img src="<?php echo $cu['logo']['url'];?>" width="143" height="78" alt="<?php echo $cu['name'];?>" title="<?php echo $cu['name'];?>"/>
                </div>
                <?php endforeach;?>
            </div>
        </div>
    </div>
    <div class="main-right">
        <?php get_template_part('block', 'register');?>
        <div class="box-aside">
            <div class="title">
                <span class="text"><?php echo TITLE_NEWS;?></span>
                <a href="" title=""><?php echo TITLE_VIEW_MORE;?> »</a>
            </div>
            <?php
                /*3 tin tức mới ở tất cả tin tức*/
                $args = array('orderby'=> 'post_date','order'=> 'DESC','posts_per_page' => 3, 'post_status' => 'publish', 'suppress_filters'=>0, 'post_type'=> 'post');
                $posts_new = get_posts( $args );
                foreach($posts_new as $p):
                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $p->ID ), 'single-post-thumbnail' );
                    if(is_array($image) && isset($image[0]))
                        $image = $image[0];
                    else
                        $image = '';
            ?>
            <article class="item">
                <a href="" title="" class="thumb">
                    <img src="<?php echo $image;?>" width="300" height="120" alt="<?php echo $p->post_title;?>" title="<?php echo $p->post_title;?>"/>
                </a>
                <h3>
                    <a href="" title="<?php echo $p->post_title;?><"><?php echo $p->post_title;?></a>
                </h3>
            </article>
            <?php endforeach;?>
        </div>
    </div>
</section><!--//fix-->
<?php get_footer(); ?>